﻿// <copyright file="IMapFrom.cs" company="DataAbstractor">
//   (c) Luke Geraghty 2013
// </copyright>
// <summary>
//   Interface mapping for the destination class property.
// </summary>

namespace DataAbstractor
{
    using System;
    using System.Linq.Expressions;

    /// <summary>
    /// Interface mapping for the destination class property.
    /// </summary>
    /// <typeparam name="TDestination">The destination type.</typeparam>
    /// <typeparam name="TSource">The source type.</typeparam>
    public interface IMapFrom<TDestination, TSource>
    {
        /// <summary>
        /// Get the destination member to map.
        /// </summary>
        /// <param name="destination">The destination field.</param>
        /// <returns>Class for the source mapping.</returns>
        IMapTo<TDestination, TSource> From(Expression<Func<TDestination, object>> destination);

        /// <summary>
        /// Ignore a destination member.
        /// </summary>
        /// <param name="destination">The destination field.</param>
        /// <returns>The current class.</returns>
        IMapFrom<TDestination, TSource> Ignore(Expression<Func<TDestination, object>> destination);

        /// <summary>
        /// Run a method on mapping completion.
        /// </summary>
        /// <param name="method">Method to run.</param>
        /// <returns>The current class.</returns>
        IMapFrom<TDestination, TSource> Run(Action<TDestination, TSource> method);
    }
}
